//
//  WinRecordCell.m
//  YunGou
//
//  Created by macbook on 16/5/18.
//  Copyright © 2016年 macbook. All rights reserved.
//

#import "WinRecordCell.h"
#import "NSString+DateTransform.h"
#import <UIImageView+WebCache.h>

@interface WinRecordCell ()
@property (weak, nonatomic) IBOutlet UIImageView *goodsImg;
@property (weak, nonatomic) IBOutlet UILabel *goodsName;
@property (weak, nonatomic) IBOutlet UILabel *issueLabel;
@property (weak, nonatomic) IBOutlet UILabel *totalNeedLabel;
@property (weak, nonatomic) IBOutlet UILabel *luckyNumLabel;
@property (weak, nonatomic) IBOutlet UILabel *announceLabel;

@end

@implementation WinRecordCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setWinRecordModel:(WinRecordModel *)winRecordModel{
    _winRecordModel = winRecordModel;
    [_goodsImg sd_setImageWithURL:[NSURL URLWithString:[ImageUrl stringByAppendingString:winRecordModel.uphoto]]];
    _goodsName.text = winRecordModel.shopname;
    _issueLabel.text = [NSString stringWithFormat:@"参与期号：%@",winRecordModel.qishu];
    _totalNeedLabel.text = [NSString stringWithFormat:@"总需人次：%@",winRecordModel.zongrenshu];
    _luckyNumLabel.text = [NSString stringWithFormat:@"幸运号码：%@",winRecordModel.huode];
    _announceLabel.text = [NSString stringWithFormat:@"揭晓时间：%@",[NSString timeTransformWithString:winRecordModel.q_end_time andFormatter:@"yyyy-MM-dd HH:mm:ss"]];
}

//晒单
- (IBAction)showRecordClicked:(id)sender {
    if (self.showRecordBlock) {
        self.showRecordBlock(_winRecordModel);
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
